package com.oocl.o2o.admin.entity;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;

import org.hibernate.annotations.GenericGenerator;

/**
 * 
 * in order to save the failReason when the status=3
 *
 */
@Entity
@GenericGenerator(strategy="uuid",name="failreasonuuid")
public class FailReason {
	@Id
	@GeneratedValue(generator="failreasonuuid")
	@Column(columnDefinition = "char(32)")
	private String id;
	@OneToOne(targetEntity=Merchant.class,cascade=CascadeType.PERSIST)
	@JoinColumn(name="merchant_id",nullable=false,columnDefinition="char(32)")
	private Merchant merchant;
	private String reasonContent;
	
	public FailReason() {
		super();
	}
	
	
	
	public FailReason(Merchant merchant, String reasonContent) {
		super();
		this.merchant = merchant;
		this.reasonContent = reasonContent;
	}



	public FailReason(String id, Merchant merchant, String reasonContent) {
		super();
		this.id = id;
		this.merchant = merchant;
		this.reasonContent = reasonContent;
	}
	public Merchant getMerchant() {
		return merchant;
	}
	public void setMerchant(Merchant merchant) {
		this.merchant = merchant;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	
	
	public String getReasonContent() {
		return reasonContent;
	}
	public void setReasonContent(String reasonContent) {
		this.reasonContent = reasonContent;
	}
	
	
	
}
